CanvasRenderingContext2D.prototype.strokeRoundRect = function (x, y, w, h, r) {
  if (w < 2 * r) r = w / 2;
  if (h < 2 * r) r = h / 2;
  this.beginPath();
  this.moveTo(x+r, y);
  this.arcTo(x+w, y,   x+w, y+h, r);
  this.arcTo(x+w, y+h, x,   y+h, r);
  this.arcTo(x,   y+h, x,   y,   r);
  this.arcTo(x,   y,   x+w, y,   r);
  this.stroke();	
  this.closePath();
  return this;
}

CanvasRenderingContext2D.prototype.fillRoundRect = function (x, y, w, h, r) {
  if (w < 2 * r) r = w / 2;
  if (h < 2 * r) r = h / 2;
  this.beginPath();
  this.moveTo(x+r, y);
  this.arcTo(x+w, y,   x+w, y+h, r);
  this.arcTo(x+w, y+h, x,   y+h, r);
  this.arcTo(x,   y+h, x,   y,   r);
  this.arcTo(x,   y,   x+w, y,   r);
  this.fill();	
  this.closePath();
  return this;
}

CanvasRenderingContext2D.prototype.strokeCircle = function (x, y, radius) {
	this.beginPath();		
	this.arc(x, y, radius, 0, 2 * Math.PI);			
	this.stroke();			
	this.closePath();
}

CanvasRenderingContext2D.prototype.fillCircle = function (x, y, radius) {
	this.beginPath();		
	this.arc(x, y, radius, 0, 2 * Math.PI);			
	this.fill();			
	this.closePath();
}

CanvasRenderingContext2D.prototype.strokeLine = function (xa, ya, xb, yb) {
	this.beginPath();
	this.moveTo(xa, ya);
	this.lineTo(xb, yb);			
	this.stroke();
	this.closePath();
}
